<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>创建两个person对象</title>
	</head>
	<body>
		<div id="test"></div>
	</body>
	<script type="text/javascript">
		function Person(){
			this.nation="汉族";
			this.skinColor="黄色";
			this.getnation=function(){
				return this.nation;
			}
			this.getskin=function(){
				return this.skinColor;
			}
		}
		function Woman(sex){
			this.sex=sex;
			
		}
		Woman.prototype=new Person();
		Woman.prototype.getsex=function(){
			return this.sex;
		}
		
		var Woman1=new Woman("女");
		
		var ss="民族："+Woman1.nation+"<br/>"+"肤色："+Woman1.skinColor+"<br/>"+"性别："+Woman1.sex;
		document.getElementById("test").innerHTML=ss;
	</script>
</html>
